<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>

    <script>
        $(function () {
            $("#ajaxButton").click(submitFunction);
        });
        //jquery ajax 上传 参考
        function submitFunction() {
            //这里唯一需要注意的就是这个form-add的id
            var formData = new FormData($("#form-add")[0]);
            $.ajax({
                //接口地址
                url: '/superPartnerActive/upload' ,
                type: 'POST',
                data: formData,
                async: false,
                cache: false,
                contentType: false,
                processData: false,
                success: function (data) {
                    console.log("hello hello");
                    //成功的回调
                    if(data.code == 300){
                    }
                },
                error: function (returndata) {
                    console.log("erro erro");
                    //请求异常的回调
                    // modals.warn("网络访问失败，请稍后重试!");
                }
            });
        }
    </script>

</head>
<body>
<!--<script src="${ctxPath}/static/modular/pack/regCode.js" type="text/javascript" charset="utf-8"></script>-->
<!--<button onclick="card_package_create();"> hello</button>-->
<form enctype="multipart/form-data" method="post" action="/api/test/upload" id="form-add">
    <input type="file" name="file"/>
    <input type="submit" value="表单上传"/>
    <input type="button" id="ajaxButton" value="ajax上传"/>
</form>

</body>
</html>